package com.blacktry.service.impl;

import com.blacktry.entity.model.Timetable;

import com.blacktry.entity.model.Vo.Daily;
import com.blacktry.mapper.TimetableMapper;
import com.blacktry.service.DailyService;
import com.blacktry.service.TimetableService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author blackTry
 * @since 2021-12-08
 */
@Service
public class TimetableServiceImpl extends ServiceImpl<TimetableMapper, Timetable> implements TimetableService {
    @Override
    public Map<String, String> selectTime(String username) {
        Map<String,String> map = new HashMap<>();
        List<String> list = this.baseMapper.selectTime(username);
        for (String str : list) {
            map.put(str,str);
        }
        return map;
    }

    @Autowired
    private DailyService dailyService;

    @Override
    public Map<String, Daily> selectDaySchedule(String username, String day) {
        return dailyService.selectdaily(username, day);
    }
}
